//
//  GLFont.h
//  Tetravex
//
//  Created by Holmes Futrell on 7/18/08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "GLSprite.h"

#import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES2/gl.h>

#import <CoreText/CTFont.h>

@interface GLFont : NSObject {
	unsigned int size;
	CTFontRef fontRef;

	GLubyte color[4];
	GLubyte strokeColor[4];
	GLfloat stroke;
	
	GLSprite *atlasSprite;
	GLshort *vertices;
	GLfloat *texCoords;
	GLfloat *advances;
	double ascent, descent;
	
}

-(id)initWithFontPath:(NSString *)path 
				 size:(int)size
				color:(GLubyte *)color
				stroke:(float)stroke
			strokeColor:(GLubyte *)strokeColor;

-(id)initWithFontName:(NSString *)name
				 size:(int)size
				color:(GLubyte *)color
			   stroke:(float)stroke
		  strokeColor:(GLubyte *)strokeColor;

//-(GLSprite *)spriteForText:(NSString *)text color:(GLubyte *)color;

-(void)drawString:(NSString *)string;
-(void)drawString:(NSString *)string kerning:(float)kerning;
-(CGSize)sizeForString:(NSString *)string kerning:(float)kerning;
-(CGSize)sizeForString:(NSString *)string;

+(void)mapVerticesToAttributeLocation:(GLuint)location;
+(void)mapTexCoordsToAttributeLocation:(GLuint)location;


-(void)drawDebug;

@property (readonly) CTFontRef font;

@end
